<?php

namespace common\models\hospital;

use Yii;

/**
 * This is the model class for table "jg_patient_expense_total".
 *
 * @property int $id
 * @property int $business_type 业务类型
 * @property string $card_id 卡号
 * @property string $patient_name 患者姓名
 * @property string $doctor_name 医生姓名
 * @property int $section 科室
 * @property double $sales_money_all 销价金额
 * @property double $discounted_money_all 折后金额
 * @property double $buy_money_all 进价金额
 * @property double $difference_money_all 进销差额
 * @property string $event_time 发生时间
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 * @property string $total_md5 业务类型+患者姓名+医生姓名+科室+发生时间(md5加密)
 */
class ExpenseTotal extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static $pix = '';

    public static function tableName()
    {
        return '{{%patient_expense_total_'.self::$pix.'}}';
    }

    public static function primaryKey()
    {
        return ['id'];
    }

    public static function getDb()
    {
        return Yii::$app->db3;
    }

    /**
     * {@inheritdoc}
     */
//    public function rules()
//    {
//        return [
//            [['business_type', 'patient_name', 'doctor_name', 'section', 'sales_money_all', 'discounted_money_all', 'buy_money_all', 'difference_money_all', 'event_time', 'created_at', 'updated_at'], 'required'],
//            [['business_type', 'section', 'created_at', 'updated_at'], 'integer'],
//            [['sales_money_all', 'discounted_money_all', 'buy_money_all', 'difference_money_all'], 'number'],
//            [['event_time'], 'safe'],
//            [['patient_name', 'doctor_name'], 'string', 'max' => 50],
//        ];
//    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'business_type' => 'Business Type',
            'card_id' => 'Card Id',
            'patient_name' => 'Patient Name',
            'doctor_name' => 'Doctor Name',
            'section' => 'Section',
            'sales_money_all' => 'Sales Money All',
            'discounted_money_all' => 'Discounted Money All',
            'buy_money_all' => 'Buy Money All',
            'difference_money_all' => 'Difference Money All',
            'event_time' => 'Event Time',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
